﻿using aspNetCURD.Models;
using Microsoft.EntityFrameworkCore;
using System;

namespace aspNetCURD.Database
{
    public class AppDbContext : DbContext
    {
        public AppDbContext(DbContextOptions<AppDbContext> options) : base(options)
        {

        }
        public DbSet<Student> student { get; set; }
        public DbSet<sc> sc { get; set; }
        public DbSet<course> course { get; set; }
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<sc>()
                .HasKey(e => new { e.sno, e.cno });
        }
    }
}
